package org.hxyjs.task;


import org.hxyjs.dao.RefreshChartDao;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.sql.SQLException;

@Component
public class ChartTask {
    @Resource
    RefreshChartDao refreshChartDao;
    @Scheduled(cron = "0/60 * * * * ? ") // 间隔20秒执行

    public void taskChartSynch() throws SQLException, ClassNotFoundException {
         refreshChartDao.getRestaurantTop3byordersize();
         //System.out.println("111");
         //System.out.println(LocalDate.now()+ " " + LocalTime.now() +" springboot定时任务");
    }
}
